import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;

public class Ranking {
	private FileOutputStream fout = null;
	private DataOutputStream out = null;
	int count;
	DoublyLinkedList[] h;
	double d[];
	BubbleSort sort=new BubbleSort();
	public void DailyRank(DoublyLinkedList[] h1){
	    h=h1;
	    count=h[0].getCount();
	    d=new double[count];
	    System.out.println(count);
	    for(int head=0;head<count-1;head++){
	    d[head]= h[0].getValue();
	    System.out.println(d[head]);
	  }
	  d=sort.bubbleSort(d);
	 
	  try {
	  File fi = new File("D:\\Tomcat 5.5\\webapps\\ROOT\\UCDapp\\Daily.xml");
	  fout = new FileOutputStream(fi);
	  out = new DataOutputStream(fout);
	 
		
		    for(int cou=0;cou<count-1;cou++){
			out.writeBytes("<place>"+h[0].FindbyVal(d[cou])+"</place>"+"\r");
            out.writeBytes("<daily data>"+d[cou]+"</daily data>"+"\r");
		  }
	  
	  out.close();
	  fout.close();
	  System.out.println("ok");
	  }
	  catch (Exception ex) {
	  ex.printStackTrace();
	  System.out.println("ex " + ex);
	  }

} 
}

